package com.springcloudexercise.userservice.Controller;




import com.springcloudexercise.baseservice.FeignInterface.UserServiceOneFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserServiceTwo {

    private UserServiceOneFeign userServiceOneFeign;

    @Autowired
    public UserServiceTwo(UserServiceOneFeign userServiceOneFeign) {
        this.userServiceOneFeign = userServiceOneFeign;
    }

    @GetMapping("/getUserInfo")
    Object getUserInfo(){
        System.out.println("调用baseservice的UserServiceFeign接口");
        return userServiceOneFeign.getUserInfo();
//        return new UserInfo().setName("张三2").setAge(25).setGender("男").setMarried('N');
    }

    @PostMapping("/addUserInfo")
    Object addUserInfo(@RequestBody Object user){
        return user;
    }

}
